package cn.kasa.org.domain;

import cn.kasa.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
* @Description: domain
* @Author: LiuXinYu
* @Version: 1.0
* @Date:  2022/6/21 18:24
*/

@Data
public class Department extends BaseDomain {

        // 上级部门
        private Long parent_id;
        // 部门管理员
        private Long manager_id;
        // 部门状态 - 1启用，0禁用
        private Integer state;
        // 部门的上级分类层级id
        private String dirPath;
        // 部门名称
        private String name;
        // 部门编号
        private String sn;

        private Employee manager;

        private Department parent;

        @JsonInclude(JsonInclude.Include.NON_EMPTY)
        private List<Department> children = new ArrayList<>();

        @Override
        public String toString() {
                return "Department{" +
                        "id=" + this.getId() +
                        "parent_id=" + parent_id +
                        ", manager_id=" + manager_id +
                        ", state=" + state +
                        ", dirPath='" + dirPath + '\'' +
                        ", name='" + name + '\'' +
                        ", sn='" + sn + '\'' +
                        ", manager=" + manager +
                        ", parent=" + parent +
                        ", children=" + children +
                        '}';
        }
}
